

*******REPLICATION FILES FOR TABLES B7-B9*******************
******************************************
cap cd "/GhanaPaper_Governance/ReplicationFiles"
cap use "./Data/pol_baseline_AuditsPaper.dta", clear

foreach var of varlist _all {
	cap replace `var' = . if inlist(`var', 777, 888, 999)
}

* Labels
lab var gender_respondent "Respondents sex (0 = Male, 1 = Female)"
lab var resp_age "Age at last birthday"
lab var emp_public "Number of years in the public sector"
lab var yrs_jobn "Number of years in current job"
lab var emp_elect "Elected to current position"
lab var reelection_el "Eligible for reelection"
lab var reelection_int "Intend to run for reelection"
lab var resp_resident "Number of years living in this district"
lab var party "Affiliated with a political party"

tabulate resp_ed, gen(ed_)
lab var ed_1 "Education: Some basic schooling"
lab var ed_2 "Education: Basic school completed"
lab var ed_3 "Education: Some secondary/high school"
lab var ed_4 "Education: Secondary/high school completed"
lab var ed_5 "Education: Post-secondary qualifications"
lab var ed_6 "Education: Some university"
lab var ed_7 "Education: University completed"
lab var ed_8 "Education: Post-graduate"


* Balance Table: Baseline
*ssc install ietoolkit

iebaltab gender_respondent resp_age resp_resident ed_* yrs_jobn emp_elect reelection_el reelection_int party, ///
grpvar(list_3) ///
savetex("/GhanaPaper_Governance/ReplicationFiles/balancetable_baseline.tex") replace

**# Bookmark #1



****************************************************************************
*MIDLINE
set more off 
cap cd "/GhanaPaper_Governance/ReplicationFiles"
cap use "./Data/pol_midline_AuditsPaper.dta", clear

foreach var of varlist _all {
	cap replace `var' = . if inlist(`var', 777, 888, 999)
}

* Labels
lab var sex_respondent "Respondents sex (0 = Male, 1 = Female)"
lab var resp_age "Age at last birthday"
lab var resp_resident "Number of years living in this district"
*lab var emp_public "B2: Number of years in the public sector"
lab var yrs_job "Number of years in current job"
*lab var emp_elect "B3a: Elected to current position"
*lab var reelection_el "B10: Eligible for reelection"
*lab var reelection_int "B11: Intend to run for reelection"
lab var party "Affiliated with a political party"

destring sex_respondent, force replace
destring resp_resident, force replace
destring resp_age, force replace
destring resp_ed, force replace
destring party, force replace
destring yrs_job, force replace

tabulate resp_ed, gen(ed_)


lab var ed_1 "Education: Basic school completed"
lab var ed_2 "Education: Some secondary/high school"
lab var ed_3 "Education: Secondary/high school completed"
lab var ed_4 "Education: Post-secondary qualifications"
lab var ed_5 "Education: Some university"
lab var ed_6 "Education: University completed"
lab var ed_7 "Education: Post-graduate"

* Balance Table: Midline
*ssc install ietoolkit

iebaltab sex_respondent resp_age resp_resident ed_* yrs_job party, ///
grpvar(list_3) ///
savetex("/GhanaPaper_Governance/ReplicationFiles/balancetable_midline.tex") replace


****************************************************************************
*ENDLINE
set more off 
cap cd "/GhanaPaper_Governance/ReplicationFiles"
cap use "./Data/pol_midline_AuditsPaper.dta", clear

foreach var of varlist _all {
	cap replace `var' = . if inlist(`var', 777, 888, 999)
}

* Labels
lab var sex_respondent "Respondents sex (0 = Male, 1 = Female)"
lab var resp_age "Age at last birthday"
lab var resp_resident "Number of years living in this district"
*lab var emp_public "B2: Number of years in the public sector"
lab var yrs_job "Number of years in current job"
*lab var emp_elect "B3a: Elected to current position"
*lab var reelection_el "B10: Eligible for reelection"
*lab var reelection_int "B11: Intend to run for reelection"
lab var party "Affiliated with a political party"

destring sex_respondent, force replace
destring resp_resident, force replace
destring resp_age, force replace
destring resp_ed, force replace
destring party, force replace
destring yrs_job, force replace

tabulate resp_ed, gen(ed_)

lab var ed_1 "Education: No formal schooling"
lab var ed_2 "Education: Some basic schooling"
lab var ed_3 "Education: Basic school completed"
lab var ed_4 "Education: Some secondary/high school"
lab var ed_5 "Education: Secondary/high school completed"
lab var ed_6 "Education: Post-secondary qualifications"
lab var ed_7 "Education: Some university"
*lab var ed_8 "Education: University completed"
*lab var ed_9 "Education: Post-graduate"

* Balance Table: Endline
*ssc install ietoolkit

iebaltab sex_respondent resp_age resp_resident ed_* yrs_job party, ///
grpvar(list_3) ///
savetex("/GhanaPaper_Governance/ReplicationFiles/balancetable_endline.tex") replace



